<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/main.css" />
<link type="text/css" rel="stylesheet" href="css/pager.css" />
<script type="text/javascript" src="js/AIRAliases.js"></script> 
<script type="text/javascript" src="js/AIRMenuBuilder.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/core.js"></script>
<script type="text/javascript" src="js/db.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/sort.js"></script>
<script type="text/javascript" src="js/article.js"></script>
<script type="text/javascript" src="js/pager.js"></script>
<script type="text/javascript" src="js/AIRIntrospector.js"></script>
<title>法律法规库 - 巴彦淖尔市“148”协调指挥中心法律服务二所</title>
<script type="text/javascript">
//如果数据文件不存在，使用标准数据文件
if(!air.File.applicationStorageDirectory.resolvePath($root_dir + "data/main.db").exists)
{
	copy_file($root_dir + "core/base.db", $root_dir + "data/main.db");	
}
var $sort, $db = new db("data/main.db");


$(function(){
	var window_menu = air.ui.Menu.createFromXML($root_dir + "core/menu.xml"); 
	air.ui.Menu.setAsMenu(window_menu);
	delete window_menu;
	
	//绑定搜索事件
	$("#search form").submit(function(){
		$val = $.trim($("#search_title").val());
		if(!$val)
		{
			alert("请输入要搜索的内容");
			return false;
		}
		$article.get_list(null, $val);
		return false;
	});
	
	//显示首页内容
	menu_home();
});

$(window).load(function(){
	//处理搜索框
	$("#search").css("left", window.innerWidth - $("#search").outerWidth() - 50);
	$("#search").css("top", window.innerHeight - $("#search").outerHeight() - 10);
	$("#search_title").focus(function(){
		$("#search").fadeTo(1, 1);
	}).blur(function(){
		$("#search").fadeTo(1, 0.4);
	});
	menu_search();
	
	$(window).resize(function(){
		$("#search").css("left", window.innerWidth - $("#search").outerWidth() - 50);
		$("#search").css("top", window.innerHeight - $("#search").outerHeight() - 10);
	});
		
});

</script> 
</head>

<body>

<ul id="sort" class="menu"></ul>
<div class="clear"></div>
<div id="article"></div>
<div id="search">
	<form action="">
		<input type="text" id="search_title" name="search_title" size="15" />
		<input type="image" src="img/icon/search.gif" />
	</form>
	
</div>

</body>
</html>
